module.exports = {
  apps: [{
    name: 'lab-web',
    script: './start-server.js',
    instances: 1, // standalone模式建议使用单实例
    exec_mode: 'fork',
    env: {
      NODE_ENV: 'production',
      PORT: 3000
    },
    env_production: {
      NODE_ENV: 'production',
      PORT: 3000
    },
    // 日志配置
    log_file: './logs/combined.log',
    out_file: './logs/out.log',
    error_file: './logs/error.log',
    log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
    
    // 监控和重启配置
    max_memory_restart: '1G',
    min_uptime: '10s',
    max_restarts: 10,
    autorestart: true,
    watch: false,
    
    // 集群配置
    merge_logs: true,
    
    // 进程配置
    kill_timeout: 5000
  }]
};